#pragma once

#include <map>

#include "Globals.h"
#include "GLTexture2D.h"
#include "GLTextureFont2D.h"

namespace game_engine
{

/*!
 * \class TextureManager
 * \brief 
 */
class TextureManager
{
///////////////////////////////////////////////////////////////////////////////
// Attribute definition
///////////////////////////////////////////////////////////////////////////////
private:
    static bool instanceFlag;
    static TextureManager *manager;

    map<string, open_gl::GLTexture2D> textures;
    map<string, open_gl::GLTextureFont2D> fonts;

///////////////////////////////////////////////////////////////////////////////
// Method definition
///////////////////////////////////////////////////////////////////////////////
public:
    // Constructors and destructors
    virtual ~TextureManager(void);

    // Others
    void purgeTextures(void);
    void purgeFonts(void);

    // Getters
    static TextureManager* getInstance(void);
    const open_gl::GLTexture2D& getTexture(const string &name) const;
    const open_gl::GLTextureFont2D& getFont(const string &name) const;

    // Setters
    void setTexture(const string &filename, const INT32 type) throw(...);
    void setFont(const string &filename, const INT32 type, const UINT32 ro, 
        const UINT32 col, const UINT32 pixelsWidth, const UINT32 pixelsHeight,
        const UINT32 spacing, const UINT32 off);

private:
    TextureManager(void);

};

}
